﻿using System;

namespace jQueryLib
{
    public abstract partial class JQueryInstance
    {
        /// <summary>
        /// Get the value of a style property for the first element in the set of matched elements.
        /// </summary>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        public abstract object Css(string propertyName);

        /// <summary>
        /// Set one CSS properties for the set of matched elements.
        /// </summary>
        /// <param name="propertyName"></param>
        /// <param name="val"></param>
        /// <returns></returns>
        public abstract JQueryInstance Css(string propertyName, object val);

        /// <summary>
        /// Set one or more CSS properties for the set of matched elements.
        /// </summary>
        /// <param name="propertyName"></param>
        /// <param name="func">object function(int index, object oldVal)
        /// <para>this keyword in JScript is the current element.</para>
        /// <para>index: position in element set</para>
        /// <para>oldVal: the old css property value</para>
        /// <para>return: css property value to be set</para>
        /// </param>
        /// <returns></returns>
        public abstract JQueryInstance Css(string propertyName, Func<object, int, object> func);

        /// <summary>
        /// Set CSS properties for the set of matched elements.
        /// </summary>
        /// <param name="map">A map of property-value pairs to set. Can use anonymous object in C#</param>
        /// <returns></returns>
        public abstract JQueryInstance Css(object map);

        /// <summary>
        /// Get the current computed height for the first element in the set of matched elements.
        /// </summary>
        /// <returns></returns>
        public abstract int Height();

        /// <summary>
        /// Set the CSS height of every matched element.
        /// </summary>
        /// <param name="height"></param>
        /// <returns></returns>
        public abstract JQueryInstance Height(int height);

        /// <summary>
        /// Set the CSS height of every matched element.
        /// </summary>
        /// <param name="func">int function(int index, int oldHeight)
        /// <para>this keyword in JScript is the current element.</para>
        /// <para>index: position in element set</para>
        /// <para>oldghtHei: the old height value</para>
        /// <para>return: height value to be set</para>
        /// </param>
        /// <returns></returns>
        public abstract JQueryInstance Height(Func<int, int, int> func);

        /// <summary>
        /// Get the current computed height for the first element in the set of matched elements, including padding but not border.
        /// </summary>
        /// <returns></returns>
        public abstract int InnerHeight();

        /// <summary>
        /// Get the current computed width for the first element in the set of matched elements, including padding but not border.
        /// </summary>
        /// <returns></returns>
        public abstract int InnerWidth();

        /// <summary>
        /// Get the current coordinates of the first element in the set of matched elements, relative to the document.
        /// </summary>
        /// <returns></returns>
        public abstract Coordinates Offset();

        /// <summary>
        /// Set the current coordinates of every element in the set of matched elements, relative to the document.
        /// </summary>
        /// <param name="coords"></param>
        /// <returns></returns>
        public abstract JQueryInstance Offset(Coordinates coords);

        /// <summary>
        /// Set the current coordinates of every element in the set of matched elements, relative to the document.
        /// </summary>
        /// <param name="func">Coordinate function(int index, Coordinate oldCoords)        
        /// <para>index: position in element set</para>
        /// <para>oldCoords: the old coordinate value</para>
        /// <para>return: new coordinate to be set</para>
        /// </param>
        /// <returns></returns>
        public abstract JQueryInstance Offset(Func<Coordinates, int, Coordinates> func);

        /// <summary>
        /// Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
        /// </summary>
        /// <returns></returns>
        public abstract Coordinates Position();

        /// <summary>
        /// Get the current computed height for the first element in the set of matched elements, including padding, border.
        /// </summary>
        /// <returns></returns>
        public abstract int OuterHeight();

        /// <summary>
        /// Get the current computed height for the first element in the set of matched elements, including padding, border and margin.
        /// </summary>
        /// <param name="includeMargin"></param>
        /// <returns></returns>
        public abstract int OuterHeight(bool includeMargin);

        /// <summary>
        /// Get the current computed width for the first element in the set of matched elements, including padding, border.
        /// </summary>
        /// <returns></returns>
        public abstract int OuterWidth();

        /// <summary>
        /// Get the current computed width for the first element in the set of matched elements, including padding, border and margin.
        /// </summary>
        /// <param name="includeMargin"></param>
        /// <returns></returns>
        public abstract int OuterWidth(bool includeMargin);

        /// <summary>
        /// Get the current computed width for the first element in the set of matched elements.
        /// </summary>
        /// <returns></returns>
        public abstract int Width();

        /// <summary>
        /// Set the CSS width of each element in the set of matched elements.
        /// </summary>
        /// <param name="width"></param>
        /// <returns></returns>
        public abstract int Width(int width);

        /// <summary>
        ///  Set the CSS width of each element in the set of matched elements.
        /// </summary>
        /// <param name="func">int function(int index, int oldWidth)        
        /// <para>index: position in element set</para>
        /// <para>oldCoords: the old width value</para>
        /// <para>return: new width to be set</para>
        /// </param>
        /// <returns></returns>
        public abstract int Width(Func<int, int, int> func);

        /// <summary>
        /// Get the current vertical position of the scroll bar for the first element in the set of matched elements.
        /// </summary>
        /// <returns></returns>
        public abstract int ScrollTop();

        /// <summary>
        /// Set the current vertical position of the scroll bar for each of the set of matched elements.
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public abstract JQueryInstance ScrollTop(int value);

        /// <summary>
        /// Get the current horizontal position of the scroll bar for the first element in the set of matched elements.
        /// </summary>
        /// <returns></returns>
        public abstract int ScrollLeft();

        /// <summary>
        /// Set the current horizontal position of the scroll bar for each of the set of matched elements.
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public abstract JQueryInstance ScrollLeft(int value);
    }
}
